#include "complex.h"

Complex::Complex()
{

}

Complex::Complex(int real, int imag)
{
    this->real = real;
    this->imag = imag;
}

int Complex::getReal() const
{
    return real;
}

void Complex::setReal(int value)
{
    real = value;
}

int Complex::getImag() const
{
    return imag;
}

void Complex::setImag(int value)
{
    imag = value;
}

QString Complex::toString()
{
    return QString("(%1 %2 %3i)").arg(real).arg(imag >= 0 ? '+' : '-').arg(imag >= 0 ? imag : -imag);
}
